// {
//   "records": [
//     {
//       "id": 3378,
//       "spuName": "zxczx",
//       "description": "zxcz",
//       "category3Id": 61,
//       "tmId": 25,
//       "spuSaleAttrList": null,
//       "spuImageList": null
//     },
//   ],
//   "total": 21,
//   "size": 3,
//   "current": 1,
//   "searchCount": true,
//   "pages": 7
// },
//上传图片数据类型
import type { UploadUserFile } from "element-plus";

export interface SpuListApiParams {
  page: number;
  limit: number;
  category3Id: number;
}

export interface SpuListItem {
  id: number;
  spuName: string;
  description: string;
  category3Id: number;
  tmId: number;
}

export type SpuList = SpuListItem[];

export interface SpuListRes {
  records: SpuList;
  total: number;
  size: number;
  current: number;
  searchCount: boolean;
  pages: number;
}

//销售属性相关数据类型
//品牌列表
export interface BaseSaleAttrItem {
  id: number;
  name: string;
}
export type BaseSaleAttrList = BaseSaleAttrItem[];

export interface SpuImageItem {
  id?: number;
  imgName: string;
  imgUrl: string;
}

export type SpuImageList = SpuImageItem[];

export interface SpuSaleAttrValueItem {
  baseSaleAttrId: number;
  id?: number;
  saleAttrValueName: string;
}

export type SpuSaleAttrValueList = SpuSaleAttrValueItem[];

export interface SpuSaleAttrItem {
  baseSaleAttrId: number;
  id?: number;
  saleAttrName: string;
  isEdit: boolean;
  spuSaleAttrValueList: SpuSaleAttrValueList;
}

export type SpuSaleAttrList = SpuSaleAttrItem[];

export interface AddSetSpuApiParams {
  category3Id?: number;
  description: string;
  id?: number;
  tmId?: number;
  spuName: string;
  spuSaleAttrList: SpuSaleAttrList;
}

export interface SpuItem extends AddSetSpuApiParams {
  spuImageList: SpuImageList; // 发送请求，接口需要的类型
}

export interface AddSetSpuListItem extends AddSetSpuApiParams {
  spuImageList: UploadUserFile[]; // element-plus定义的数据，收集到的数据类型
}
